from lighthouse import settings
import os,uuid
def recevierpics(f):
    imgname = str(uuid.uuid4())+".jpg"
    imgname=imgname.replace("-","")
    imagesrc=os.path.join(settings.STATIC_BASE,"media",imgname)
    try:
        with open(imagesrc,"wb") as f1:
            for chunk in f.chunks():
                f1.write(chunk)
    except:
        os.remove(imagesrc)
        return
    imgstasrc = os.path.join("\static","media",imgname)
    imgstasrc=imgstasrc.replace("\\","/")
    return imgstasrc